/*
** Copyright (c) 2001 PIXAR.  All rights reserved.  This program or
** documentation contains proprietary confidential information and trade
** secrets of PIXAR.  Reverse engineering of object code is prohibited.
** Use of copyright notice is precautionary and does not imply
** publication.
**
**                      RESTRICTED RIGHTS NOTICE
**
** Use, duplication, or disclosure by the Government is subject to the
** following restrictions:  For civilian agencies, subparagraphs (a) through
** (d) of the Commercial Computer Software--Restricted Rights clause at
** 52.227-19 of the FAR; and, for units of the Department of Defense, DoD
** Supplement to the FAR, clause 52.227-7013 (c)(1)(ii), Rights in
** Technical Data and Computer Software.
**
** Pixar
** 1200 Park Ave
** Emeryville, CA 94608
**
** ----------------------------------------------------------------------------
*/
/* code generated by slim 6.0, RAT 6.0 (Mar 11 2004 04:21:00) */
/* for kidd@localhost at: Sat Mar 12 18:54:25 FLE Standard Time 2005 */

/* includes ---------------------------------*/
#include "pxslUtil.h"

/* defines ----------------------------------*/
#define SLIM_TYPEID_surface 0
#define SLIM_TYPEID_displacement 1
#define SLIM_TYPEID_volume 2
#define SLIM_TYPEID_light 3
#define SLIM_VERSION 600
#define SLIM_SHADERTYPE light
#define SLIM_SHADERTYPEID SLIM_TYPEID_light
#define SLIM_INSTANCETYPE light
#define SLIM_INSTANCENAME Distant
#define SLIM_DIRECTIONAL_SHADOWS 1

/* shader body ------------------------------*/
SLIM_SHADERTYPE
SLIM_INSTANCENAME (
  output varying float __nonspecular=0;
  output varying float __nondiffuse=0;
  output varying color __inShadowC=color(0,0,0);
)
{

/* static functions ----------------------*/

/* dynamic functions ------------------------*/

/* local variables --------------------------*/

/* main body --------------------------------*/
  uniform vector axis = vector "shader"(0,0,1);
  __inShadowC = color(0);
  solar(axis, 0.0) {
    varying float atten;
    varying point PP = transform("shader", Ps);
    varying float sloc, tloc;
    sloc = abs(xcomp(PP));
    tloc = abs(ycomp(PP));
    if (0 != 1) {
      if(0 == 0) {
        atten = (1 - filterstep(.5, sloc)) *
                (1 - filterstep(.5, tloc));
      } else {
        atten = (1-smoothstep(.5-0,.5,sloc)) *
         (1 - smoothstep(.5-0,.5, tloc)) ;
      }
      atten *= filterstep(0, zcomp(PP));
    } else atten = 1;
    atten *= 1 / pow(length(L), 0);
    __nondiffuse = 1 - 1;
    __nonspecular = 1 - 1;
    Cl = atten * 1 * color(1,1,1);
    Cl = pxslCmix(Cl, color(0,0,0), __inShadowC);
  }
}

